function getClientInfo() {
    return {
      "name" : "预览-实时预览音符音高（跟随走带位置）",
      "category" : "AKD",
      "author" : "akd",
      "versionNumber" : 1,
      "minEditorVersion" : 65540
    };
  }
  function trackindex(){
    var project = SV.getProject()
    for(var i =0;i<project.getNumTracks();i++){
      if(project.getTrack(i).getName()=="5a8e8ed5"){return i}
    }
  }

  function setInterval(t, callback) {
    callback();
    SV.setTimeout(t, setInterval.bind(null , t, callback));
  }

function JiDeBaGongChengTuoJinLai(){
  var i = trackindex()
  var Coordinate = SV.getMainEditor().getNavigation()
  var timeaxis = SV.getProject().getTimeAxis()
  var track = SV.getProject().getTrack(i)
  var groupreference = track.getGroupReference(1)
  var playback = SV.getPlayback()
  var selectednote = SV.getMainEditor().getSelection().getSelectedNotes()[0]
if(SV.getMainEditor().getSelection().hasSelectedNotes()){
  if(SV.getProject().getNoteGroup("73bbc69c-58ae-44ae-8c74-9f33d807bfa7").getName()!=selectednote.getPitch()){
    playback.loop(timeaxis.getSecondsFromBlick((selectednote.getPitch()-12)*2000000000+groupreference.getOnset()),timeaxis.getSecondsFromBlick((selectednote.getPitch()-11)*2000000000+groupreference.getOnset()))
    SV.getProject().getNoteGroup("73bbc69c-58ae-44ae-8c74-9f33d807bfa7").setName(selectednote.getPitch())
  }
}
else{if(SV.getProject().getNoteGroup("73bbc69c-58ae-44ae-8c74-9f33d807bfa7").getName()<120&&SV.getProject().getNoteGroup("73bbc69c-58ae-44ae-8c74-9f33d807bfa7").getName()!=0){
  //let timeleft = Coordinate.getTimeViewRange()
  playback.loop(0,0)
  SV.getProject().getNoteGroup("73bbc69c-58ae-44ae-8c74-9f33d807bfa7").setName(Coordinate.getTimeViewRange()[0])
  playback.stop()
  Coordinate.setTimeLeft(SV.getProject().getNoteGroup("73bbc69c-58ae-44ae-8c74-9f33d807bfa7").getName())
  SV.getArrangement().getNavigation().setTimeLeft(SV.getProject().getNoteGroup("73bbc69c-58ae-44ae-8c74-9f33d807bfa7").getName())
}else{
  if(playback.getStatus()=="looping"&&(timeaxis.getBlickFromSeconds(playback.getPlayhead())<Coordinate.getTimeViewRange()[0]||timeaxis.getBlickFromSeconds(playback.getPlayhead())>Coordinate.getTimeViewRange()[1])
  ){
    Coordinate.setTimeLeft(timeaxis.getBlickFromSeconds(playback.getPlayhead()))

  }
}
}
}

//function massage(){
 // SV.showMessageBox("1", "1");
//}

  function main() {
//WhatCanISayManbaOut()
    setInterval(100,JiDeBaGongChengTuoJinLai)
    //SV.showMessageBox(trackindex(), 1)
    //SV.finish();
  }